Encoding: Fix _wp_scan_utf8() budget scanning#49
Open
sirreal wants to merge 11 commits into
Open
Conversation
When _wp_scan_utf8() is called with max_code_points but no max_bytes, the ASCII fast path previously called strspn() across the entire remaining ASCII run before checking the code point limit. This made _wp_utf8_codepoint_span( large ASCII text, 0, 5 ) scan the full string. Bound strspn() by the remaining code point budget. ASCII code points are one byte, so this preserves the returned span and found count while avoiding work past the budget. Local benchmark, 10 MB ASCII _wp_utf8_codepoint_span( ..., 0, 5 ): original 3.183709 ms, patched 0.001250 ms. Differential fuzz: 189847 span/found cases and 2750 valid mb_substr sanity cases, no mismatches.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Reject icon names that use uppercase letters, that lack a namespace prefix, or that have already been registered. Add tests covering these cases. Props im3dabasia1, mukesh27, wildworks. See #64847. git-svn-id: https://develop.svn.wordpress.org/trunk@62515 602fd350-edb4-49c9-b593-d223f7449a82
Give interactive elements a consistent 40px height in the admin mobile viewport on the Add Plugins, Media Library grid, Settings > General, and Add Themes screens. Follow-up to [61645]. Props abcd95, wildworks. Fixes #64999. git-svn-id: https://develop.svn.wordpress.org/trunk@62516 602fd350-edb4-49c9-b593-d223f7449a82
…ors. Includes: * Standardizing default values on `null` vs. `false`. * Updating the documentation to correct parameter types. * Adding missing parameter descriptions. Follow-up to [22094]. Props Soean, mukesh27, SergeyBiryukov. See #64897. git-svn-id: https://develop.svn.wordpress.org/trunk@62517 602fd350-edb4-49c9-b593-d223f7449a82
Add `core/list-item` to the block attributes supported by block bindings so its `content` rich text can be bound, and cover the basic (non-nested) case in the render tests. This is a clean enablement with no render-side changes. A List Item that contains a nested List keeps both inside the same `<li>`; preserving that nested list when `content` is bound is handled separately by the `WP_Block::replace_html()` inner-block fix. Props sauliusv, cbravobernal. See #65406. git-svn-id: https://develop.svn.wordpress.org/trunk@62518 602fd350-edb4-49c9-b593-d223f7449a82
Developed in WordPress#12207. Follow-up to [62507]. Props dmsnell. See #64896. git-svn-id: https://develop.svn.wordpress.org/trunk@62519 602fd350-edb4-49c9-b593-d223f7449a82
…locks. The `wp_get_elements_class_name()` function previously generated CSS class names by hashing the serialized block data via `md5()`. Identical blocks received the same `wp-elements-*` class name and the Style Engine deduplicated their CSS rules into one, causing a parent block's element style (e.g. link color) to cascade down and override a child block's identical style due to CSS source order. The function is updated to use `wp_unique_prefixed_id()` instead, generating sequential unique class names (`wp-elements-1`, `wp-elements-2`, etc.) that match the block editor's JavaScript implementation. The now-unused `$parsed_block` parameter is removed from the function signature. PHPStan rule level 10 errors are also resolved in the related code. See #64898. Developed in WordPress#12126. Follow-up to r53260, r58074. Props tusharbharti, westonruter, wildworks. Fixes #65435. git-svn-id: https://develop.svn.wordpress.org/trunk@62520 602fd350-edb4-49c9-b593-d223f7449a82
…ogo. Adds gray WordPress logo image files (`w-logo-gray-white-bg.png` and `w-logo-gray-white-bg.svg`) to `wp-includes/images/`, and updates `the_embed_site_title()` and `do_favicon()` to use the new images as the fallback site icon, maintaining visual consistency with the login screen logo updated in r61989. Replaces CSS custom property references for focus styles in the embed template (`--wp-admin-theme-color` and `--wp-admin-border-width-focus`) with their literal values, as these admin-theme variables are not defined in the oEmbed template context. Developed in WordPress#11293. Follow-up to r61652, r61989, r62502. Props sabernhardt, huzaifaalmesbah, westonruter, jamesbregenzer. See #64708. Fixes #64877. git-svn-id: https://develop.svn.wordpress.org/trunk@62521 602fd350-edb4-49c9-b593-d223f7449a82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_wp_scan_utf8()ASCII fast-path scanning by the remaining code point budget.Testing
codex review --base trunk.Trac ticket: https://core.trac.wordpress.org/ticket/65372
Use of AI Tools
AI assistance: Yes
Tool(s): Claude, Codex
Model(s): Fable 5, GPT-5.5
Used for: Fuzz test design, diagnosis, PR description cleanup, and code review.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.